﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="QLMatHang.aspx.cs" Inherits="Web.Shalo.BanPMS1.Admin.QLMatHang" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentAdmin" runat="server">
    
    <!--  start page-heading -->
	<div id="page-heading">
		<h1>Quản Lý Loại Hàng</h1>
	</div>
	<!-- end page-heading -->

	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized"><img src="images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized"><img src="images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td>
		<!--  start content-table-inner ...................................................................... START -->
		<div id="content-table-inner">
		
			<!--  start table-content  -->
			<div id="table-content">
			
			    <asp:MultiView ID="MultiView1" runat="server">
                    <asp:View ID="View1" runat="server">
                        <table style="width: 100%">
                            <tr>
                                <td><h2>Danh Sách Loại Hàng</h2>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:GridView ID="GVLoaiHang" CssClass="mGrid" runat="server" Height="238px" Width="330px" 
                                        AutoGenerateColumns="False" AllowPaging="True" 
                                        onpageindexchanging="GVLoaiHang_PageIndexChanging" 
                                         PageSize="6" onselectedindexchanging="GVLoaiHang_SelectedIndexChanging">
                                        <Columns>
                                            <asp:BoundField DataField="MaLH" HeaderText="Mã LH" />
                                            <asp:BoundField DataField="TenLH" HeaderText="TênLH" />
                                            <asp:ButtonField CommandName="Select" ControlStyle-CssClass="link" Text="Chọn" >
                                            <ControlStyle CssClass="link" />
                                            <ItemStyle HorizontalAlign="Center" />
                                            </asp:ButtonField>
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </asp:View>
                    <br />
                    <asp:View ID="View2" runat="server">
                        <table style="width: 100%">
                            <tr>
                                <td><h2>Danh Sách Mặt Hàng Của 
                                    <asp:Label ID="labTenLH" runat="server" Text="Label"></asp:Label>
                                    </h2>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:GridView ID="GVMatHang" CssClass="mGrid" runat="server" AutoGenerateColumns="False" 
                                        Width="1000px" onselectedindexchanging="GVMatHang_SelectedIndexChanging" 
                                        AllowPaging="True" onpageindexchanging="GVMatHang_PageIndexChanging" 
                                        onrowdeleting="GVMatHang_RowDeleting">
                                        <Columns>
                                            <asp:BoundField DataField="MaMH" HeaderText="Mã MH" >
                                            <ItemStyle Width="50px" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="TenMH" HeaderText="Tên LH" >
                                            <ItemStyle Width="150px" />
                                            </asp:BoundField>
                                            <asp:TemplateField HeaderText="Hình">
                                                <EditItemTemplate>
                                                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                                                </EditItemTemplate>
                                                <ItemTemplate>
                                                    <asp:Image ID="Image1" runat="server" Height="52px" 
                                                        ImageUrl='<%# Eval("Hinh","~/Images/{0}") %>' Width="54px" />
                                                </ItemTemplate>
                                                <ItemStyle HorizontalAlign="Center" />
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="GiaBan" HeaderText="Giá Bán" >
                                            <ItemStyle Width="60px" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="SLBan" HeaderText="SL Bán" >
                                            <ItemStyle HorizontalAlign="Center" Width="50px" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="SLNhap" HeaderText="SL Nhập" >
                                            <ItemStyle HorizontalAlign="Center" Width="50px" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="NhaSX" HeaderText="Nhà SX" />
                                            <asp:BoundField DataField="MoTa" HeaderText="Mô Tả" />
                                            <asp:ButtonField CommandName="Select" Text="Sửa" ControlStyle-CssClass="link" >
                                            <ControlStyle CssClass="link" />
                                            <ItemStyle HorizontalAlign="Center" />
                                            </asp:ButtonField>
                                            <asp:ButtonField CommandName="Delete" Text="Xóa"  ControlStyle-CssClass="link">
                                            <ControlStyle CssClass="link" />
                                            <ItemStyle HorizontalAlign="Center" />
                                            </asp:ButtonField>
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="btnTaoMoiMH" CssClass="btn" runat="server" 
                                        Text="Tạo Mới Mặt Hàng" onclick="btnTaoMoiMH_Click" />
                                    <asp:Button ID="btnDSLH" CssClass="btn" runat="server"  
                                        Text="Danh Sách Loại Hàng" onclick="btnDSLH_Click" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </asp:View>
                    <br />
                    <asp:View ID="View3" runat="server">
                        <table style="width: 100%">
                            <tr>
                                <td colspan="2"><h2>Cập Nhật Mặt Hàng</h2>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    Tên loại hàng:</td>
                                <td>
                                    <asp:Label ID="labTenLH2" runat="server" Text="Label"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 92px; height: 16px">
                                </td>
                                <td style="height: 16px">
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 92px; height: 14px;">
                                    Tên mặt hàng:</td>
                                <td style="height: 14px">
                                    <asp:TextBox ID="txtTenMH" CssClass="in" runat="server" Height="27px" 
                                        Width="261px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                        ErrorMessage="(*)" ControlToValidate="txtTenMH" Display="Dynamic" 
                                        ForeColor="Red"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    Hình:</td>
                                <td>
                                    <asp:FileUpload ID="txtHinh" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    &nbsp;</td>
                                <td>
                                    <asp:Image ID="ImageHinh" runat="server" Height="97px" Width="117px" />
                                    <asp:HiddenField ID="HidHinh" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    Giá bán:</td>
                                <td>
                                    <asp:TextBox ID="txtGiaBan" runat="server" Height="23px" 
                                        Width="163px"></asp:TextBox>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                                        ControlToValidate="txtGiaBan" Display="Dynamic" ErrorMessage="Nhập Số" 
                                        ForeColor="Red" ValidationExpression="^\d+$" ValidationGroup="Check"></asp:RegularExpressionValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    Nhà sản xuất:</td>
                                <td>
                                    <asp:TextBox ID="txtNhaSX" runat="server" Height="24px" 
                                        Width="164px"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                        ErrorMessage="(*)" ControlToValidate="txtNhaSX" ForeColor="Red"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    Mô tả:</td>
                                <td>
                                    <asp:TextBox ID="txtMoTa" CssClass="form-textarea" runat="server" 
                                        TextMode="MultiLine"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                        ErrorMessage="(*)" ControlToValidate="txtMoTa" Display="Dynamic" 
                                        ForeColor="Red"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 92px; height: 26px;">
                                    </td>
                                <td style="height: 26px">
                                    <asp:Button ID="btnThemMH" CssClass="btn" runat="server" Text="Tạo Mới" 
                                        onclick="btnThemMH_Click" />
                                    <asp:Button ID="btnSuaMH" CssClass="btn"  runat="server" Text="Lưu" 
                                        onclick="btnSuaMH_Click" />
                                    <asp:Button ID="btnDSMH" CssClass="btn" runat="server" 
                                        Text="Hủy" onclick="btnDSMH_Click" 
                                        CausesValidation="False" />
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 92px">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </asp:View>
                    <br />
                    <br />
                </asp:MultiView>
			
			</div>
			<!--  end table-content  -->
	
			<div class="clear"></div>
		 
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>
	<div class="clear">&nbsp;</div>

 
</asp:Content>
